package com.example.bili.view.activity;

import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.example.bili.R;
import com.example.bili.base.BaseActivity;


/**
 * Created by Administrator on 2017/3/10.
 */

public class Webactivity extends BaseActivity {
    private WebView webview;

    @Override
    protected void initview() {
        webview = (WebView) findViewById(R.id.webview);
    }

    @Override
    public int getLayoutView() {
        return R.layout.web;
    }

    @Override
    protected void m_oncreate() {
        String weburl = getIntent().getStringExtra("weburl");
        webview.loadUrl(weburl);
        webview.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                //返回值是true的时候控制去WebView打开，为false调用系统浏览器或第三方浏览器
                view.loadUrl(url);
                view.loadUrl(url);
                return false;
            }
        });
    }
}
